Improve auth token UX: profile selection and better empty-state handling#4584
Merged
simonfaltum merged 4 commits intomainfrom Feb 25, 2026
Merged
Improve auth token UX: profile selection and better empty-state handling#4584simonfaltum merged 4 commits intomainfrom
auth token UX: profile selection and better empty-state handling#4584simonfaltum merged 4 commits intomainfrom
Conversation
…dling When `databricks auth token` is invoked with no arguments, replace the raw host prompt with smarter resolution: 1. Check DATABRICKS_HOST env var (highest priority) 2. Check DATABRICKS_CONFIG_PROFILE env var 3. Interactive mode: show a profile selector with "Enter host manually" and "Create new profile" options 4. Non-interactive mode: clear error messages guiding users to --profile or databricks auth login Existing behavior (--profile, --host, positional args) is unchanged. Also extracts applyUnifiedHostFlags helper to reduce duplication, simplifies test context handling, and adds acceptance tests for the non-interactive no-args cases.
Collaborator
|
Commit: 6000fff
21 interesting tests: 7 KNOWN, 7 SKIP, 6 flaky, 1 RECOVERED
Top 20 slowest tests (at least 2 minutes):
|
When selecting "Create a new profile" from the interactive profile picker, run the login flow inline instead of returning an error. Also reorder the action items so "Create a new profile" appears before "Enter a host URL manually" to prioritize the more common path.
shreyas-goenka
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
databricks auth tokenis invoked with no arguments, resolve through env vars (DATABRICKS_HOST,DATABRICKS_CONFIG_PROFILE) first, then show an interactive profile picker or a clear non-interactive error. This is part of us moving away from a host-focused auth experience, to a profile-focused auth experienceInteractive profile picker
Item ordering rationale:
Search mode (
>5profiles):<=5profiles: All items visible without scrolling, no search needed."Create a new profile" runs login inline
Selecting "Create a new profile" now runs the full
auth loginflow inline (prompt for profile name, prompt for host, OAuth browser challenge, save to.databrickscfg) and then returns the token — instead of printing an error telling the user to run a separate command.Non-interactive mode
"no profile specified. Use --profile <name>"(profiles exist)"no profiles configured. Run 'databricks auth login'"(no profiles)Unchanged
--profile,--host, and positional arg behaviorTest plan
no-args-with-profilesandno-args-no-profilesmake lintfullandmake checkspass